{% extends "::base.html.twig" %}
{% block body %}
<h1>Device list</h1>

<table class="table table-striped">
    <thead>
        <tr>
            <th>Id</th>
            <th>Inv</th>
            <th>Room</th>
            <th>Person</th>
            <th>Producer</th>
            <th>Year</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
    {% for entity in entities %}
        <tr>
            <td><a href="{{ path('device_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
            <td>{{ entity.inv }}</td>
            <td>{{ entity.room }}</td>
            <td><a href="{{ path('personal_show', {'id' : entity.personal.id}) }}">{{ entity.personal.pib }}</a></td>
            <td>{{ entity.producer }}</td>
            <td>{{ entity.year }}</td>
            <td>
                <ul>
                    <li>
                        <a href="{{ path('device_show', { 'id': entity.id }) }}">show</a>
                    </li>
                    <li>
                        <a href="{{ path('device_edit', { 'id': entity.id }) }}">edit</a>
                    </li>
                </ul>
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>

<ul>
    <li>
        <a href="{{ path('device_new') }}">
            Create a new entry
        </a>
    </li>
</ul>
{% endblock %}
